package com.zijin.exec;

import java.util.Scanner;

public class Text11 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.print("请输入一个四位整数：");
        int n = scanner.nextInt();
        int thousands = n / 1000;
        int hundreds = (n / 100) % 10;
        int tens = (n / 10) % 10;
        int units = n % 10;
        System.out.println("千位数字：" + thousands + (thousands % 2 == 0 ? "（偶数）" : "（奇数）"));
        System.out.println("百位数字：" + hundreds + (hundreds % 2 == 0 ? "（偶数）" : "（奇数）"));
        System.out.println("十位数字：" + tens + (tens % 2 == 0 ? "（偶数）" : "（奇数）"));
        System.out.println("个位数字：" + units + (units % 2 == 0 ? "（偶数）" : "（奇数）"));
        int sum = thousands + hundreds + tens + units;
        System.out.println("各位数字之和：" + sum);
    }
}
